package com.example.vo;

import com.example.entity.Role;
import lombok.Data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
public class UserVo extends BaseVo {

    private static final long serialVersionUID = -8356027808424327115L;

    /**
     * 用户名
     */
    private String username;
    /**
     * 用户姓名
     */
    private String name;

    private String password;

    private String email;

    private String phoneNumber;

    private String avatar;

    private boolean locked;
    /**
     * 角色
     */
    private List<Role> roles;

    private Date lastPasswordResetDate;

    private String access_token;

    private String token_type;

    private String refresh_token;

    private long expires_in;

    private String scope;

    @Override
    public List<QueryParam> buildQueryParams() {
        List<QueryParam> queryParams = new ArrayList<>();
        queryParams.add(new QueryParam("username", QueryParam.Operator.EQ, username));
        queryParams.add(new QueryParam("name", QueryParam.Operator.LIKE, name));
        return queryParams;
    }
}
